package site.action;

import java.util.Map;

import javax.annotation.Resource;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;

import site.service.HomeService;

import com.opensymphony.xwork2.ActionSupport;

public class HomeAction extends ActionSupport {

    private static final long serialVersionUID = 1L;

    private Map indexInfo;

    @Resource
    private HomeService homeService;

    @Action(value = "/home", results = { @Result(name = "success", type = "freemarker", location = "/pages/home/Home.ftl") })
    public String init() {
        indexInfo = homeService.queryIndexInfo();
        return SUCCESS;
    }

    @Action(value = "/hello", results = { @Result(name = "success", type = "freemarker", location = "/pages/home/Hello.ftl") })
    public String testHello() {
        return SUCCESS;
    }

    public Map getIndexInfo() {
        return indexInfo;
    }

    public void setIndexInfo(Map indexInfo) {
        this.indexInfo = indexInfo;
    }
}
